<template>
      <swiper>
      <!-- v-for现在必须要跟key，不然语法报错 -->
      <swiper-item v-for="(item,index) in banners" :key='index' >
        <a :href="item.link">
          <img :src="item.image" alt="" @load="imgekiad">
        </a>
      </swiper-item>
    </swiper>
</template>

<script>
import {Swiper,SwiperItem} from "@/components/common/swiper/index";
export default {
    name:"HomeSwiper",
    props:{
      banners:{
        type:Array,
        default(){
          return[]
        }
      }
    }
    ,data() {
      return {
        isnode:false
      }
    },
    components:{
      Swiper,
      SwiperItem

    },
    methods:{
      imgekiad(){
        if(!this.isnode){
          this.$emit("swiperImgeIoad")
          this.isnode=true
        }
          
      }
    }
}
</script>

<style>

</style>